'Declaration
<JetBrains.Annotations.AssertionMethodAttribute()> <JetBrains.Annotations.NotNullAttribute()> Protected Overloads Function DisposeGuardNotNull(Of TResult)( _ ByVal function As Func(Of TResult), _ ByVal throwOnDisposed As Boolean _ ) As TResult
'Usage
Dim instance As DisposableObject Dim function As Func(Of TResult) Dim throwOnDisposed As Boolean Dim value As TResult value = instance.DisposeGuardNotNull(Of TResult)(function, throwOnDisposed)
[JetBrains.Annotations.AssertionMethod()] [JetBrains.Annotations.NotNull()] protected TResult DisposeGuardNotNull<TResult>( Func<TResult> function, bool throwOnDisposed )
[JetBrains.Annotations.AssertionMethod()] [JetBrains.Annotations.NotNull()] protected: TResult^ DisposeGuardNotNullgeneric<typename TResult> ( Func<TResult^>^ function, bool throwOnDisposed )
Parameters
- function
- The function to be invoked.
The value of this parameter cannot be
null
(Nothing
in Visual Basic). - throwOnDisposed
- Whether to throw an exception when the object is disposed.
Type Parameters
- TResult
- The type of the return value of the function.
Return Value
This method never returns null
(Nothing
in Visual Basic).